<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>marginTop 使用% 是相较于谁的</title>
    <style>
        *{
            padding: 0px;
            margin: 0px;
        }
        div {
            width: 300px;
            height: 600px;
        }
        .box1 {
            overflow: hidden;
            background-color: brown;
            /* writing-mode:vertical-lr; */
        }
        .box2 {
            width: 200px;
            /* writing-mode: horizontal-tb; */
            /* 这里的50% marginTop并不是父元素的高度 */
            margin-top: 50%;
            background-color: chartreuse;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2">
            子元素div2 marginTop 使用% 并不是相较于父元素高度的百分比，而是父元素宽度的
        </div>
    </div>
</body>
</html>